<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        .swiper {
            width: 100%;
            height: 640px;
            background: url(./images/banner.jpg) no-repeat center;
        }
        .swiper2{
            height: 670px;
            position: relative;
        }
        .swiper2 img{
            height: 100%;
            position: absolute;
            left: 50%;
            top: 50%;
            transform: translate(-50%, -50%)
        }
.box{
    width: 100px;
    height: 100px;
    border: 1px solid red;
}

.box:hover{
    z-index: 2;
    box-shadow: 0 7px 15px rgba(0,0,0,.1);
    transform: translate3d(0,-5px,0)
}
        * {
            margin: 0;
            padding: 0;
        }

        .w {
            width: 100%;
            height: 400px;
            background-color: pink;
        }

        .logo {
            float: left;
            width: 125px;
            height: 23px;
            line-height: 23px;
            background-color: red;
            background: url(images/logo-b.png);
            background-size: cover;
        }
    </style>
</head>

<body>
    <div class="box"></div>
    <div class="swiper"></div>
    <div class="swiper2">
        <img src="./images//swiper-0.jpg" alt="">
    </div>

    <div class="w">
        <div class="logo">
            askdj
        </div>
    </div>
    <script>
        function combo(msg) {
            var arr = msg.split("-");//[get,element,by,id]
            for (var i = 1; i < arr.length; i++) {
                arr[i] = arr[i].charAt(0).toUpperCase() + arr[i].substr(1, arr[i].length
                    - 1);//Element
            }
            msg = arr.join("");//msg=” getElementById”
            return msg;
        }
        console.log(combo('get-element-by-id'))
        var Array = [];
        //接下来定义一个函数，这个函数是写10~100的随机数，我们现在把他封装成一个函数
        function getRandom(num1, num2) {
            var transition = num2 - num1 + 1;//这里面的加1是为了能够取到100
            var res = Math.floor(Math.random() * transition + num1);
            return res;
        }
        console.log(getRandom(10, 100))
        var url = 'http://item.taobao.com/item.htm?a=1&b=2&c=&d=xxx&e'
        function reparam(url) {
            var url = url.split('?')[1]
            var arr = url.split('&')
            console.log(arr)
            var o = {}
            for (let i = 0; i < arr.length; i++) {
                var temp = arr[i].split('=')
                // console.log(temp[0])
                var a = temp[0]
                var b = temp[1]
                // console.log(a,b)
                if (!b) {
                    if (b == '') {
                        b = ''
                    } else if (b == undefined) {
                        b = undefined
                    }
                }
                o[a] = b
                // o.temp[0] = temp[1]
            }
            console.log(o)
            console.log(JSON.stringify(o))
        }
        reparam(url)

        var a = NaN, b = 'undefined'
        console.log(a + b)
            //上面的代码已经获取了num1~num2的随机数
            //下面是遍历出10个随机数,并把十个数用push放法放到新定义的数组里面
            // for(var i = 0; i < 10; i++){
            //     Array.push(getRandom(10,100));
            // }
            // //最后用sort方法进行排序
            // Array.sort(function(a,b){
            //     return a > b;
            // })
            // //打印数组Array
            // console.log(Array);
    </script>
</body>

</html>